home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Development Platforms / CSMP Digests / csmp-v1-013.txt < prev    next >
Encoding:
Text File  |  1992-11-18  |  43.2 KB  |  1,230 lines  |  [TEXT/MPS ]

  1. C.S.M.P. Digest             Wed, 11 Mar 92       Volume 1 : Issue 13
  2.  
  3. Today's Topics:
  4.  
  5.     Getting a non-apple-event-aware app to open a document
  6.     Out of memory? Like hell!
  7.     Avoid using Multi-Finder!!
  8.     SADE "Bad type information" bug ?
  9.     Getting data out of a AEDesc -- the apple way...
  10.     Munger question
  11.     ADB Device Handler ID's anyone?
  12.     PICT creation in temp. memory... how?
  13.     MacApp 2.01 w/ C++ Undo Problems
  14.  
  15.  
  16. The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly.
  17.  
  18. These digests are available (by using FTP, account anonymous, your email
  19. address as password) in the pub/mac/csmp-digest directory on ftp.cs.uoregon.
  20. edu (try skinner.cs.uoregon.edu if that doesn't work).  This is also the home
  21. of the comp.sys.mac.programmer Frequently Asked Questions list.
  22.  
  23. The articles in these digests are taken directly from comp.sys.mac.programmer.
  24. They are not edited; all articles included in this digest are in their original
  25. posted form.  The only articles that are -not- included in these digests are
  26. those which didn't receive any replies (except those that give information
  27. rather than ask a question).  All replies to each article are concatenated
  28. onto the original article in the order in which they were received.  Article
  29. threads are not added to the digests until the last article added to the
  30. thread is at least one month old (this is to ensure that the thread is dead
  31. before adding it to the digests).
  32.  
  33. Send administrative mail to mkelly@cs.uoregon.edu.
  34.  
  35. -------------------------------------------------------
  36.  
  37. From: greeny@top.cis.syr.edu (Jonathan Greenfield)
  38. Subject: Getting a non-apple-event-aware app to open a document
  39. Date: 3 Feb 92 15:46:06 GMT
  40. Organization: CIS Dept., Syracuse University
  41.  
  42. Can anyone give me a pointer to information on forcing an application that
  43. is not apple-event-aware to open a document.  (As the Finder does)
  44.  
  45. It's no problem to launch an application and get it to open a document
  46. (then, the Finder will automatically convert an 'odoc' event into the
  47. appropriate form).  But if the application is already running, it is a
  48. bit more difficult.
  49.  
  50. Thanks for any info.
  51.  
  52. --
  53. greeny                                           greeny@top.cis.syr.edu
  54.  
  55. "What's the difference between an orange?"
  56.  
  57.  
  58.  
  59. - -------------------------
  60.  
  61. From: Joe.Francis@dartmouth.edu (Joe Francis)
  62. Subject:  Getting a non-apple-event-aware app to open a document
  63. Date: 4 Feb 92 11:54:15 GMT
  64. Organization: Dartmouth College, Hanover, NH
  65.  
  66. In article <1992Feb3.104606.12290@newstand.syr.edu>
  67. greeny@top.cis.syr.edu (Jonathan Greenfield) writes:
  68. > Can anyone give me a pointer to information on forcing an application that
  69. > is not apple-event-aware to open a document.  (As the Finder does)
  70. > It's no problem to launch an application and get it to open a document
  71. > (then, the Finder will automatically convert an 'odoc' event into the
  72. > appropriate form).  But if the application is already running, it is a
  73. > bit more difficult.
  74.  
  75. Under system 7, you send it an 'odoc' event.  If the target process has
  76. a File menu with an Open item, system 7 will fake a
  77. mousedown/menuselect/sfgetfile sequence to prod the app into opening
  78. the appropriate document.
  79.  
  80.  
  81.  
  82. - -------------------------
  83.  
  84. From: leonardr@ccs.itd.umich.edu
  85. Subject:  Getting a non-apple-event-aware app to open a document
  86. Date: 3 Feb 92 18:44:47 GMT
  87. Organization: Campus Computing Sites, University of Michigan-Ann Arbor
  88.  
  89. In article <1992Feb3.104606.12290@newstand.syr.edu> greeny@top.cis.syr.edu (Jonathan Greenfield) writes:
  90. >Can anyone give me a pointer to information on forcing an application that
  91. >is not apple-event-aware to open a document.  (As the Finder does)
  92. >
  93. >It's no problem to launch an application and get it to open a document
  94. >(then, the Finder will automatically convert an 'odoc' event into the
  95. >appropriate form).  But if the application is already running, it is a
  96. >bit more difficult.
  97. >
  98.     As long as you are only concerned with System 7, and are sending
  99. 'odoc' events to the application - it doesn't matter whether the recieve is
  100. AEVT aware or not.  The Process Manager & the AE Manager will play some games
  101. to get your 'odoc' converted into 'MultiFinder Puppet Strings" so that the
  102. document will open. 
  103.     This is also true for the 'quit' event as well, though not for the 
  104. teh 'pdoc' event since MF never puppet stringed that one since it has a number
  105. of technical problems.
  106.  
  107.     If you wanted to open docs in already running apps under Sys6 you
  108. would have to reimplement the 'puppet string' mechanism yourself which 
  109. requires either an INIT or a driver.
  110.  
  111. -- 
  112. - ---------------------------------------------------------------------
  113. Leonard Rosenthol          Internet: leonardr@ccs.itd.umich.edu
  114. Director of Advanced Technology   AppleLink: MACgician
  115. Aladdin Systems, inc.          GEnie:     MACgician
  116.  
  117.  
  118.  
  119. - -------------------------
  120.  
  121. From: greeny@top.cis.syr.edu (Jonathan Greenfield)
  122. Subject:  Getting a non-apple-event-aware app to open a document
  123. Date: 7 Feb 92 17:29:01 GMT
  124. Organization: CIS Dept., Syracuse University
  125.  
  126. In article <1992Feb3.184447.13628@terminator.cc.umich.edu> leonardr@ccs.itd.umich.edu writes:
  127.  
  128. >>It's no problem to launch an application and get it to open a document
  129. >>(then, the Finder will automatically convert an 'odoc' event into the
  130. >>appropriate form).  But if the application is already running, it is a
  131. >>bit more difficult.
  132. >>
  133. >    As long as you are only concerned with System 7, and are sending
  134. >'odoc' events to the application - it doesn't matter whether the recieve is
  135. >AEVT aware or not.  The Process Manager & the AE Manager will play some games
  136. >to get your 'odoc' converted into 'MultiFinder Puppet Strings" so that the
  137. >document will open. 
  138.  
  139. (Yes, this is for System 7.)
  140.  
  141. This may be true in theory, but it does not seem to be the case in practice.
  142. One of the "snippets" specifically mentions that the *Finder* performs the
  143. conversion to "puppet strings" when it sees an 'odoc' event.  (This was in
  144. reference to launching an application with an 'odoc' event passed as a
  145. parameter.)
  146.  
  147. I guessed that it might work for 'odoc' events sent to apps that were
  148. already running--but it just doesn't seem to work.  The 'odoc' event is
  149. properly accepted by apple-event-aware apps, but not by other apps.
  150.  
  151. Furthermore, the problem is not the absence of an appropriate "Open..."
  152. menu item (or an appropriate mstr resource), because drag-and-drop from the
  153. Finder works on these apps (even when they are already running).
  154.  
  155. So here is the basic problem I am having:
  156.  
  157.    1) Program is successful in launching applications and *at the same time*
  158.       opening a document (or documents), for all applications that support
  159.       drag-and-drop.
  160.  
  161.    2) Program is successful in coercing an apple-event-aware app into
  162.       opening a document (or documents), when it is already running.
  163.  
  164.    3) Program *fails* to coerce non-apple-event-aware apps into opening
  165.       a document (or documents), when they are already running.
  166.  
  167.  
  168. This problem has really baffled me.  Does anybody have any idea why the
  169. "puppet string" conversion might fail to work as advertised?  
  170.  
  171. (It would seem to me that more has to be done by the Finder to coerce a 
  172. *running* app to open a document, than for one that is just being launched.
  173. But a few people have claimed that sending an 'odoc' event works.  How did
  174. you do it?!  Did you do something special?)
  175.  
  176. Thanks for any help.
  177.  
  178. --
  179. J. S. Greenfield                                         greeny@top.cis.syr.edu
  180. (I like to put 'greeny' here, 
  181. but my d*mn system wants a 
  182. *real* name!)                        "What's the difference between an orange?"
  183.  
  184.  
  185.  
  186. - -------------------------
  187.  
  188. From: johnsd2@vccsouth28.its.rpi.edu (Daniel Norman Johnson)
  189. Subject:  Getting a non-apple-event-aware app to open a document
  190. Organization: Information Technology Services, Rennselaer Polytechnic Institute.
  191. Date: Sat, 8 Feb 1992 18:14:05 GMT
  192.  
  193. > - Various things about AppleEvents omited, because I'm not even going to
  194. > - mention AppleEvents after this line...
  195.  
  196. >   3) Program *fails* to coerce non-apple-event-aware apps into opening
  197. >      a document (or documents), when they are already running.
  198.  
  199.  
  200. > This problem has really baffled me.  Does anybody have any idea why the
  201. > "puppet string" conversion might fail to work as advertised?  
  202.  
  203. > (It would seem to me that more has to be done by the Finder to coerce a 
  204. > *running* app to open a document, than for one that is just being launched.
  205. > But a few people have claimed that sending an 'odoc' event works.  How did
  206. > you do it?!  Did you do something special?)
  207.  
  208. > Thanks for any help.
  209.  
  210. One point- for the MultiFinder faking trick to work (why is it called
  211. Puppet Strings, any way?), the app that is going to do the open command MUST
  212. have an "Open..." command, *NOT* an "Open" command; the 3 .s matter!
  213.  
  214. The way the finder passes documents to be opened to an app that it launches is quite different- the app has to solicit the info in question. So check that
  215. one point. It may be that the Apple Event manager IS doing the coercion, but
  216. that it is not working because of this.
  217.  
  218.  
  219.  
  220. - -------------------------
  221.  
  222. From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
  223. Subject:  Getting a non-apple-event-aware app to open a document
  224. Date: 8 Feb 92 22:19:58 GMT
  225. Organization: Royal Institute of Technology, Stockholm, Sweden
  226.  
  227. @vccsouth28.its.rpi.edu (Daniel Norman Johnson) writes:
  228.  
  229.    One point- for the MultiFinder faking trick to work (why is it called
  230.    Puppet Strings, any way?), the app that is going to do the open command MUST
  231.    have an "Open..." command, *NOT* an "Open" command; the 3 .s matter!
  232.  
  233. That's not true. The application can add "mstr" resources or
  234. "mst#" resources to explain what menu items to use (how would
  235. foreign software work else ?)
  236.  
  237. By the way, it's called "puppet strings" because MultiFinder
  238. leads the app into opening a document by pulling "strings" to
  239. the document (menu here, dialog there, shortcut a selection...),
  240. much like one of those dog/man/lizard puppets you can buy in
  241. the street :-)
  242.  
  243. --
  244. This Signature is distributed under the conditions of the Signature License,
  245. available at a fee from   h+@nada.kth.se  (Jon W{tte)  Reading the Signature
  246. implies that you accept to be bound by the terms in said License. Should you
  247. not agree on any of these terms, you must return the Signature unread to me.
  248.  
  249.  
  250.  
  251. - -------------------------
  252.  
  253. From: greeny@top.cis.syr.edu (Jonathan Greenfield)
  254. Subject:  Getting a non-apple-event-aware app to open a document
  255. Organization: CIS Dept., Syracuse University
  256. Date: Sun, 9 Feb 92 21:57:57 EST
  257.  
  258. In article <82csz##@rpi.edu> johnsd2@rpi.edu writes:
  259. >
  260. >One point- for the MultiFinder faking trick to work (why is it called
  261. >Puppet Strings, any way?), the app that is going to do the open command MUST
  262. >have an "Open..." command, *NOT* an "Open" command; the 3 .s matter!
  263.  
  264. True enough (or you need appropriate mstr or mst# resources).  This was not
  265. the problem here.  (Document opening worked fine from the Finder, itself.)
  266.  
  267. It turns out that not waiting for a reply to the apple-event was the
  268. problem.  (See previous post.)  Just one of those strange, undocumented
  269. requirements, I guess.
  270.  
  271. --
  272. J. S. Greenfield                                         greeny@top.cis.syr.edu
  273. (I like to put 'greeny' here, 
  274. but my d*mn system wants a 
  275. *real* name!)                        "What's the difference between an orange?"
  276.  
  277.  
  278.  
  279. ---------------------------
  280.  
  281. From: steveh@tasman.cc.utas.edu.au (Steve Howell)
  282. Subject: Out of memory? Like hell!
  283. Date: 5 Feb 92 14:05:32 GMT
  284. Organization: University of Tasmania, Australia.
  285.  
  286. Why is memory management on the Macintosh so primitive? I am running 
  287. system 7 on a Quadra with 20 Megabytes of RAM. When I attempt to edit
  288. my resource file with ResEdit, I frequently get "Memory is getting
  289. dangerously low - it would be a good idea to close some windows now."
  290. It is particularly infuriating when it vetoes copy and paste operations
  291. due to a lack of memory when I have ResEdit jacked up to something stupid
  292. like 4 Mb and the system shows 13 Mb of ram is idle. It would appear that
  293. it is the finder itself running out of memory. How to I give it more
  294. working space? I hate the way it runs out all the time. I'd give it a
  295. whole extra meg. if I could. Is there a program to do this? I have
  296. tried bootman to no avail. Help! This is driving me mad!
  297.  
  298. - Steve.
  299.  
  300.  
  301.  
  302. - -------------------------
  303.  
  304. From: scott@phylo.life.uiuc.edu (Scott Howard)
  305. Subject:  Out of memory? Like hell!
  306. Date: 5 Feb 92 16:59:30 GMT
  307. Organization: University of Illinois at Urbana
  308.  
  309. Perhaps you have set ResEdit to Pig Mode?
  310.  
  311.  
  312. --
  313. All views expressed are copyright 1992 Scott Howard. Any resemblance to
  314. living persons, historical events, or logically constructed arguements
  315. is purely unintentional.
  316.  
  317.  
  318.  
  319. - -------------------------
  320.  
  321. From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
  322. Subject:  Out of memory? Like hell!
  323. Date: 5 Feb 92 17:34:54 GMT
  324. Organization: Kalamazoo College
  325.  
  326. steveh@tasman.cc.utas.edu.au (Steve Howell) writes:
  327. >Why is memory management on the Macintosh so primitive?
  328.  
  329. JMP _Conclusions    ; is this really necessary?
  330.  
  331. >I am running 
  332. >system 7 on a Quadra with 20 Megabytes of RAM. When I attempt to edit
  333. >my resource file with ResEdit, I frequently get "Memory is getting
  334. >dangerously low - it would be a good idea to close some windows now."
  335.  
  336. I frequently get this error when attempting to edit corrupted files.  I
  337. don't know if it's because the files' lengths are set to something
  338. randomly huge, or because the aforementioned error is ResEdit's standard
  339. "something has gone wrong" message.
  340. -- 
  341.  Jamie McCarthy     Internet: k044477@kzoo.edu     AppleLink: j.mccarthy
  342.  Kzoo randomly kills all my mail;  if I don't acknowledge, try resending.    
  343.  
  344.  
  345.  
  346. - -------------------------
  347.  
  348. From: xx123yyy@matt.ksu.ksu.edu (Brian Gregory Howard)
  349. Subject:  Out of memory? Like hell!
  350. Date: 5 Feb 92 23:45:50 GMT
  351. Organization: Kansas State University
  352.  
  353. k044477@hobbes.kzoo.edu (Jamie R. McCarthy) writes:
  354.  
  355. >>I am running 
  356. >>system 7 on a Quadra with 20 Megabytes of RAM. When I attempt to edit
  357. >>my resource file with ResEdit, I frequently get "Memory is getting
  358. >>dangerously low - it would be a good idea to close some windows now."
  359.  
  360. >I frequently get this error when attempting to edit corrupted files.  I
  361. >don't know if it's because the files' lengths are set to something
  362. >randomly huge, or because the aforementioned error is ResEdit's standard
  363. >"something has gone wrong" message.
  364.  
  365. I had this problem the other day with ResEdit2.1.  I was tinkering with a
  366. DLOG resource and did something wrong.  I finally had to salvage what I could
  367. from the resource file and trash it.
  368.  
  369.                     Brian Howard    
  370.                     xx123yyy@matt.ksu.ksu.edu
  371.                     brian@grace.ecc.ksu.edu
  372.  
  373.  
  374.  
  375. - -------------------------
  376.  
  377. From: davidp@calvin.usc.edu (David Peterson)
  378. Subject:  Out of memory? Like hell!
  379. Date: 7 Feb 92 01:32:18 GMT
  380. Organization: University of Southern California, Los Angeles, CA
  381.  
  382.  
  383. This is a sort of irritating though.
  384.  
  385. Every once in a while I'll be doing something in ResEdit and it will run
  386. out of memory. Okay fine, quit it and up its memory partion and try again.
  387.  
  388. It always works out though that I set it to something obcenely large and 
  389. then forget to set it back before I start programming again. Then either
  390. CFront or Link run out of memory or take forever because ResEdit stole their
  391. memory from the system (and is now doing nothing with it).
  392.  
  393. Could ResEdit be changed to use spare system memory "on demand" like some
  394. of the MPW tools do? I rarely need more than the suggested 500k, but when
  395. I do I usually end up going through the above scenario.
  396.  
  397. -dave.
  398.  
  399.  
  400.  
  401. - -------------------------
  402.  
  403. Subject:  Out of memory? Like hell!
  404. From: tmaehl@vax1.umkc.edu
  405. Date: 10 Feb 92 03:52:28 CST
  406. Organization: University of Missouri Computing Services
  407.  
  408. In article <steveh.697298732@tasman>, steveh@tasman.cc.utas.edu.au (Steve Howell) writes:
  409. > Why is memory management on the Macintosh so primitive? I am running 
  410.  
  411. Hmm, Because the roots of the memory manager are in the paint program
  412. that shipped with the Lisa 8 years ago, which worked pretty well on
  413. an 128K mac.
  414.  
  415. > system 7 on a Quadra with 20 Megabytes of RAM. When I attempt to edit
  416. > like 4 Mb and the system shows 13 Mb of ram is idle. It would appear that
  417. > it is the finder itself running out of memory. How to I give it more
  418. > working space? I hate the way it runs out all the time. I'd give it a
  419. > whole extra meg. if I could. Is there a program to do this? I have
  420.  
  421. Mount your harddrive from system 6 (you'll have to do this on another
  422. mac, I think - quadras won't run 6 will they?) do a get info on the 
  423. finder and increase its memory partition to the size desired.
  424.  
  425. Jonathan/tmaehl@vax1.umkc.edu
  426.  
  427.  
  428.  
  429. ---------------------------
  430.  
  431. From: changm@cs.umn.edu (Ming-Tsung Darda Chang)
  432. Subject: Avoid using Multi-Finder!!
  433. Date: 6 Feb 92 03:44:04 GMT
  434. Organization: University of Minnesota, Minneapolis, CSci dept.
  435.  
  436. Hi, Folks:
  437.  
  438. I really need some helps or any hint to avoid using Multi-Finder when running 
  439. my program!!  I have been reading through the Tech. notes, 
  440. Inside Macintosh I-VI, but still can not help me come up with any idea.  
  441. I do hope any expert there can give me any kind of help to make my program work 
  442. on Multi-Finder without using Multi-Finder!!
  443.  
  444. I am using Think C 5.0.2.  Any kind of demo source code is appreciated!!
  445.  
  446. Thanks for your help!
  447.  
  448. Darda
  449. -- 
  450. ========================================================================
  451. = Mr. Ming-Tsung Darda Chang                                           = 
  452. =----------------------------------------------------------------------=
  453. = Computer Science Department              Internet: changm@cs.umn.edu =
  454.  
  455.  
  456.  
  457. - -------------------------
  458.  
  459. From: dougm@descartes.cns.caltech.edu (Doug McNaught)
  460. Subject:  Avoid using Multi-Finder!!
  461. Organization: California Institute of Technology
  462. Date: Thu, 6 Feb 1992 05:17:29 GMT
  463.  
  464. In article <1992Feb6.034404.19643@cs.umn.edu> changm@cs.umn.edu (Ming-Tsung Darda Chang) writes:
  465. >Hi, Folks:
  466. >
  467. >I really need some helps or any hint to avoid using Multi-Finder when running 
  468. >my program!!  I have been reading through the Tech. notes, 
  469. >Inside Macintosh I-VI, but still can not help me come up with any idea.  
  470. >I do hope any expert there can give me any kind of help to make my program work 
  471. >on Multi-Finder without using Multi-Finder!!
  472.  
  473.  I'm not sure exactly what you mean. If you want to refuse to run under MF, 
  474. there is no 'official' way to know whether MF is active or not. Otherwise, I
  475. can't puzzle out your prose--could you clarify?
  476. doug
  477. -- 
  478. <><><><><><><><><><><><><><><>Go Skins!!<><><><><><><><><><><><><><><><>
  479. <> Doug McNaught                          dougm@descartes.caltech.edu <>
  480. <>         Legalize it / Don't criticize it --- Peter Tosh            <>
  481. <><><><><><><><><><><><><><><>Go Skins!!<><><><><><><><><><><><><><><><>
  482.  
  483.  
  484.  
  485. - -------------------------
  486.  
  487. From: pdejong@fwi.uva.nl (Paul Gerard de Jong)
  488. Subject:  Avoid using Multi-Finder!!
  489. Date: 10 Feb 92 09:58:39 GMT
  490. Organization: FWI, University of Amsterdam
  491.  
  492. This is probably the most completely unclear newsmessage of the year.
  493. What is the problem, and what is your question ?
  494.  
  495. changm@cs.umn.edu (Ming-Tsung Darda Chang) writes:
  496. >Hi, Folks:
  497.  
  498. >I really need some helps or any hint to avoid using Multi-Finder when running 
  499. >my program!!  I have been reading through the Tech. notes, 
  500. >Inside Macintosh I-VI, but still can not help me come up with any idea.  
  501. >I do hope any expert there can give me any kind of help to make my program work 
  502. >on Multi-Finder without using Multi-Finder!!
  503.  
  504. >I am using Think C 5.0.2.  Any kind of demo source code is appreciated!!
  505.  
  506. >Thanks for your help!
  507.  
  508. >Darda
  509. >-- 
  510. >========================================================================
  511. >= Mr. Ming-Tsung Darda Chang                                           = 
  512. >=----------------------------------------------------------------------=
  513. >= Computer Science Department              Internet: changm@cs.umn.edu =
  514.  
  515.  
  516.  
  517. ---------------------------
  518.  
  519. From: brian@umbc4.umbc.edu (Brian Cuthie)
  520. Subject: SADE "Bad type information" bug ?
  521. Organization: University of Maryland Baltimore Campus
  522. Date: Thu, 6 Feb 1992 16:12:14 GMT
  523.  
  524.  
  525. I'm debugging a rather large Mac application with SADE.  In the process
  526. I seem to have stumbled accross my favorite SADE bug[feature].  The 
  527. problem is that when trying to examine a rather large struct (610 bytes)
  528. that's been allocated locally, SADE prints the first 6 members of the
  529. struct and then quits with:
  530.  
  531.     ### Bad type information in symbol file (618)
  532.  
  533. Anybody know what's going on here ? This problem occurs in versions of
  534. SADE ranging from 1.0 to 1.3b1.  Am *I* doing something wrong ?
  535. I've tried recompiling, etc., but nothing seems to have any effect.
  536.  
  537. Thanks.
  538.  
  539. -Brian
  540.  
  541.  
  542.  
  543.  
  544.  
  545. - -------------------------
  546.  
  547. From: ksand@apple.com (Kent Sandvik)
  548. Subject:  SADE "Bad type information" bug ?
  549. Date: 8 Feb 92 01:34:14 GMT
  550. Organization: MacDTS Mongols
  551.  
  552. In article <1992Feb6.161214.8388@umbc3.umbc.edu>, brian@umbc4.umbc.edu (Brian Cuthie) writes:
  553. > I'm debugging a rather large Mac application with SADE.  In the process
  554. > I seem to have stumbled accross my favorite SADE bug[feature].  The 
  555. > problem is that when trying to examine a rather large struct (610 bytes)
  556. > that's been allocated locally, SADE prints the first 6 members of the
  557. > struct and then quits with:
  558. >     ### Bad type information in symbol file (618)
  559. > Anybody know what's going on here ? This problem occurs in versions of
  560. > SADE ranging from 1.0 to 1.3b1.  Am *I* doing something wrong ?
  561. > I've tried recompiling, etc., but nothing seems to have any effect.
  562.  
  563. The latest official release is 1.3.1, check out if the problem is still
  564. there.
  565.  
  566. Kent
  567.  
  568.  
  569.  
  570. ---------------------------
  571.  
  572. From: gwatts@cdf34.fnal.gov (Gordon Watts -- U of Rochester)
  573. Subject: Getting data out of a AEDesc -- the apple way...
  574. Date: 7 Feb 92 04:28:07 GMT
  575. Organization: Fermilab
  576.  
  577. Hi all,
  578.   Got a quick question.  I'm working with apple events.  Lets say I have an
  579. AEDesc whose descriptorType field is typeAlias.  I want to turn it into a
  580. FSSPec record, and get out (so I can use it in a file manager call, for
  581. example).  After much puzzeling, I can find no routine to do this for me --
  582. unless I go back to AEList it came from (which I would prefer not to do).  I
  583. need something like AEGetPtr which would pull the data out of a AEDesc...
  584.  
  585.   The only think I could think of was to use AECoerceDesc as follows:
  586.  
  587.     theErr = AECoerceDesc (theAliasDesc, typeFSS, theNewFSSDesc)
  588.  
  589. and then use theNewFSSDesc.dataHandle directly.  However -- apple sais, in IM
  590. vol 6, p 6-9 top "the data referred to by the dataHandle in the descriptor
  591. record is private to the Apple Event Manager.  You can supply or extract this
  592. data only by using Apple Event Manager routines."  I haven't tried this
  593. approach yet, as I haven't had time.  I thought I would ask the net first...
  594.  
  595.   Is there some routine that will get me the data out of a plain AEDesc?
  596.  
  597.     Thanks,
  598.         Gordon.
  599.  
  600.  
  601.  
  602. - -------------------------
  603.  
  604. From: grobbins@Apple.COM (Grobbins)
  605. Subject:  Getting data out of a AEDesc -- the apple way...
  606. Date: 9 Feb 92 01:38:20 GMT
  607. Organization: The Johnson Administration
  608.  
  609. In article <QHP#DX4PG@linac.fnal.gov> gwatts@cdf34.fnal.gov writes:
  610. >Lets say I have an AEDesc whose descriptorType field is typeAlias.
  611. >...  After much puzzeling, I can find no routine to do this for me --
  612. >unless I go back to AEList it came from (which I would prefer not to do).
  613.  
  614. Unfortunately, there is no routine to act as the inverse of AECreateDesc.
  615. Usually the matter doesn't come up, since raw data is retrieved from 
  616. descriptor lists with calls like AEGetParamPtr.  But if you really have an
  617. atomic descriptor, go ahead and grab the datahandle.
  618.  
  619. >    theErr = AECoerceDesc (theAliasDesc, typeFSS, theNewFSSDesc)
  620. >and then use theNewFSSDesc.dataHandle directly.
  621.  
  622. That's fine, or you could extract the alias record and call ResolveAlias
  623. or MatchAlias on it.
  624.  
  625. Grobbins                grobbins@apple.com
  626.  
  627. Usual disclaimers apply.
  628.  
  629.  
  630.  
  631. - -------------------------
  632.  
  633. From: d88-jwa@hemul.nada.kth.se (Jon W{tte)
  634. Subject:  Getting data out of a AEDesc -- the apple way...
  635. Date: 9 Feb 92 10:50:50 GMT
  636. Organization: Royal Institute of Technology, Stockholm, Sweden
  637.  
  638. > grobbins@Apple.COM (Grobbins) writes:
  639.  
  640.    Usually the matter doesn't come up, since raw data is retrieved from 
  641.    descriptor lists with calls like AEGetParamPtr.  But if you really have an
  642.    atomic descriptor, go ahead and grab the datahandle.
  643.  
  644.    >    theErr = AECoerceDesc (theAliasDesc, typeFSS, theNewFSSDesc)
  645.    >and then use theNewFSSDesc.dataHandle directly.
  646.  
  647.    That's fine, or you could extract the alias record and call ResolveAlias
  648.    or MatchAlias on it.
  649.  
  650. That's not what IM VI says. IM VI says: NEVER EVER IN A MILLION YEARS
  651. EVEN THINK about accessing the datahandle directly. It could be a magic
  652. token for all you know. Especially when there is a ocumented way of
  653. getting data out of the descriptor:
  654.  
  655.     - Create a list
  656.     - Add the desc
  657.     - GetNthPtr
  658.     - Dispose list
  659.  
  660. One could even wrap that up in an utility function.
  661.  
  662. --
  663. This Signature is distributed under the conditions of the Signature License,
  664. available at a fee from   h+@nada.kth.se  (Jon W{tte)  Reading the Signature
  665. implies that you accept to be bound by the terms in said License. Should you
  666. not agree on any of these terms, you must return the Signature unread to me.
  667.  
  668.  
  669.  
  670. - -------------------------
  671.  
  672. From: lai@Apple.COM (Ed Lai)
  673. Subject:  Getting data out of a AEDesc -- the apple way...
  674. Date: 10 Feb 92 17:38:23 GMT
  675. Organization: Apple Computer Inc., Cupertino, CA
  676.  
  677. In article <QHP#DX4PG@linac.fnal.gov> gwatts@cdf34.fnal.gov writes:
  678. >Hi all,
  679. >  Got a quick question.  I'm working with apple events.  Lets say I have an
  680. >AEDesc whose descriptorType field is typeAlias.  I want to turn it into a
  681. >FSSPec record, and get out (so I can use it in a file manager call, for
  682. >example).  After much puzzeling, I can find no routine to do this for me --
  683. >unless I go back to AEList it came from (which I would prefer not to do).  I
  684. >need something like AEGetPtr which would pull the data out of a AEDesc...
  685. >
  686. >  The only think I could think of was to use AECoerceDesc as follows:
  687. >
  688. >    theErr = AECoerceDesc (theAliasDesc, typeFSS, theNewFSSDesc)
  689. >
  690. >and then use theNewFSSDesc.dataHandle directly.  However -- apple sais, in IM
  691. >vol 6, p 6-9 top "the data referred to by the dataHandle in the descriptor
  692. >record is private to the Apple Event Manager.  You can supply or extract this
  693. >data only by using Apple Event Manager routines."  I haven't tried this
  694. >approach yet, as I haven't had time.  I thought I would ask the net first...
  695. >
  696. >  Is there some routine that will get me the data out of a plain AEDesc?
  697. >
  698. >    Thanks,
  699. >        Gordon.
  700.  
  701. An AEDesc is a structure with four character ID, and a data handle. When
  702. they four character ID is a private type, then the data in the data handle
  703. is private. When it is a public type like PICT, TEXT, alis or private type
  704. of your own, you can just take the handle and use it directly. The reverse
  705. is also true. The way to make an alias AEDesc is to make the alias handle
  706. using whatever toolbox call you like, then just assign it as the dataHandle
  707. in the AEDesc and assign its descriptorType to 'alis'.
  708.  
  709. Actually there should be an easier solution to your problem. Where did you
  710. get the alias Desc in the first place. I can guess it is either
  711.  
  712. 1) you fetch it as a parameter from an Apple Event
  713. 2) you fetch it as an item from a Apple Event list.
  714.  
  715. In either case, when you do the fetch, do it as
  716.  
  717. AEGetKeyPtr/AEGetNthPtr(event/list, key/index, 'fss ', actualType, @theFss,
  718.   sizeof(theFss), actualSize);
  719.  
  720. (actually it is not exactly that, since AEGetKeyPtr has a different interface
  721. from AEGetNthPtr, but you get the idea).
  722.  
  723. And that is it, if it succeed, you can then use theFss directly.
  724.  
  725. /* Disclaimer: All statments and opinions expressed are my own */
  726. /* Edmund K. Lai                                               */
  727. /* Apple Computer, MS37-UP                                     */
  728. /* 20525 Mariani Ave,                                          */
  729. /* Cupertino, CA 95014                                         */
  730. /* (408)974-6272                                               */
  731. zW@h9cOi
  732.  
  733.  
  734.  
  735. ---------------------------
  736.  
  737. From: mhall@occs.cs.oberlin.edu (Matthew Hall)
  738. Subject: Munger question
  739. Organization: Oberlin College Computer Science
  740. Date: Fri, 7 Feb 1992 16:33:08 GMT
  741.  
  742. Actually, I suppose that this is more a question of gethandlesize and
  743. sethandlesize.
  744.     How can I tell if I have enough free memory to increase the
  745. size of a data block with munger, before I try to use it.  I.E, I am
  746. replacing a selection of sampled sound with another selection of
  747. sampled sound, and I need to know, will it fit?  Just checking the
  748. free memory won't work, since as IMII says, I could have 18meg left,
  749. but if a non-relocatable block is positioned above the block I'm
  750. mungering, my block can't grow. The memory management is good enough
  751. so that I don't have really fragmented heap, but before this routine,
  752. I have to lock the handle to the block I'm inserting, or perhaps,
  753. memory is just running low.  Is there a function which will return the
  754. maximum size that a block in memory can grow?  Any Pascal or C source
  755. welcome.
  756.  
  757. Thank you,
  758. Matt Hall
  759. Alternate mail address SMH9666@OBERLIN.BITNET
  760.  
  761. --
  762.  
  763. <<mhall@occs.edu OR
  764. <<SMH9666@OBERLIN.BITNET
  765.  
  766. This is just a beta version signature
  767.  
  768.  
  769.  
  770.  
  771. - -------------------------
  772.  
  773. From: Michael_Hecht@mac.sas.com (Michael Hecht)
  774. Subject:  Munger question
  775. Organization: SAS Institute Inc.
  776. Date: Mon, 10 Feb 1992 17:11:55 GMT
  777.  
  778. In article <MHALL.92Feb7113308@occs.cs.oberlin.edu>,
  779. mhall@occs.cs.oberlin.edu (Matthew Hall) writes:
  780. >     How can I tell if I have enough free memory to increase the
  781. > size of a data block with munger, before I try to use it.
  782. > [...] before this routine,
  783. > I have to lock the handle to the block I'm inserting, or perhaps,
  784. > memory is just running low.
  785.  
  786. Matt,
  787.  
  788. I would suggest two things:
  789.  
  790. *  Before locking the handle to the block to be inserted, call MoveHHi on it.
  791. That way, it won't affect the Munger operation later on in any adverse way:
  792.  
  793.    MoveHHi( insertHandle );
  794.    HLock( insertHandle );
  795.  
  796. *  Just assume the Munger will work, then check the resulting size afterwards
  797. to see if it's what you expected. If not, then it must have failed. You can
  798. try moving your destination handle high in the heap, compact the heap, and
  799. try the Munger again. Here's a routine that's worked for me:
  800.  
  801. OSErr ReplaceMem( Handle h, Size offset, Size oldSize,
  802.                                  Ptr newData, Size newSize )
  803. {
  804.     Size            finalSize;
  805.  
  806.  
  807.     /* Compute resulting size */
  808.     finalSize = GetHandleSize( h ) - oldSize + newSize;
  809.  
  810.     /* Give it a shot */
  811.     Munger( h, offset, 0, oldSize, newData, newSize );
  812.     if( finalSize == GetHandleSize( h ))
  813.         return noErr;
  814.  
  815.     /* Didn't work--blast some space in the heap */
  816.     MoveHHi( h );
  817.     CompactMem( finalSize );
  818.  
  819.     /* Then try again */
  820.     Munger( h, offset, 0, oldSize, newData, newSize );
  821.     if( finalSize != GetHandleSize( h ))
  822.         return memFullErr;
  823.  
  824.     /* It worked this time */
  825.     return noErr;
  826. }
  827.  
  828.  
  829. Hope this helps!
  830.  
  831. --Michael
  832.  
  833. =======================================================================
  834. Michael P. Hecht                 | Internet:  Michael_Hecht@mac.sas.com
  835. SAS Institute Inc.; Cary, NC USA | AppleLink: SAS.HECHT
  836.  
  837.  
  838.  
  839. ---------------------------
  840.  
  841. From: costin@cogsci.ucsd.EDU (Dan Costin)
  842. Subject: ADB Device Handler ID's anyone?
  843. Date: 7 Feb 92 21:41:56 GMT
  844. Organization: Department of Cognitive Science, UCSD
  845.  
  846. Is there a list of ADB device handler ID's out there anywhere?
  847. Apple's Guide to Hardware mentions ID = 2 or 3 for keyboards,
  848. ID = 1 or 2 for mice.  They also say you must register your ID with them.
  849. Is the list of registered devices available?
  850.  
  851. Furthermore, how can ID 2 be used by either a mouse or a keyboard,
  852. and where does it say that the keyboard on a Classic has an ID of 8,
  853. which it does?
  854.  
  855. Thanks in advance for any leads.
  856. -dan
  857.  
  858.  
  859.  
  860. - -------------------------
  861.  
  862. From: ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser)
  863. Subject:  ADB Device Handler ID's anyone?
  864. Date: 10 Feb 92 22:43:28 GMT
  865. Organization: MacDTS, Apple Computer
  866.  
  867. In article <722@cogsci.ucsd.EDU>, costin@cogsci.ucsd.EDU (Dan Costin) writes:
  868. > Is there a list of ADB device handler ID's out there anywhere?
  869. > Apple's Guide to Hardware mentions ID = 2 or 3 for keyboards,
  870. > ID = 1 or 2 for mice.  They also say you must register your ID with them.
  871. > Is the list of registered devices available?
  872. > Furthermore, how can ID 2 be used by either a mouse or a keyboard,
  873. > and where does it say that the keyboard on a Classic has an ID of 8,
  874. > which it does?
  875. > Thanks in advance for any leads.
  876. > -dan
  877.  
  878. Here are the default addresses as we assign them:
  879. 1 - security devices (dongles, etc.)
  880. 2 - keyboards
  881. 3 - mice (relative pointing devices)
  882. 4 - tablets (absolute pointing devices)
  883. 5 - modems
  884. 7 - miscellaneous
  885.  
  886. To register a device, you must purchase an ADB license from software licensing.  (You
  887. need a license to sell an ADB device at all, due to Apple's patents on the bus). Apple
  888. will then assign you a default address and a handler ID.  The list of assigned IDs is
  889. not available.
  890.  
  891. Tim Dierks
  892. MacDTS, but I speak for myself
  893.  
  894.  
  895.  
  896. ---------------------------
  897.  
  898. From: Eric.J.Baumgartner@dartmouth.edu (Eric J. Baumgartner)
  899. Subject: PICT creation in temp. memory... how?
  900. Date: 8 Feb 92 00:20:26 GMT
  901. Organization: Dartmouth College, Hanover, NH
  902.  
  903. I want to be able to create a PICT in temporary memory in System 7,
  904. rather than my applications partition.  Normally, I'd just do:
  905.  
  906. PicHandle myPICT;
  907.  
  908. myPICT = OpenPicture(&aRect);
  909.  
  910. /* all the drawing and copybits commands */
  911.  
  912. ClosePicture();
  913.  
  914. IM 6 has calls to create a handle in temp memory, after which you can
  915. use regular memory management functions.  But I can't use these with
  916. OpenPicture, because it's "special"; it signals QD to begin capturing
  917. calls.
  918.  
  919. How do I do this?  Can I fake it through the QD bottlenecks?  Do I call
  920. OpenPicture and then diddle with the ports picSave to do this?  These
  921. approaches seem plausible but I'm hoping someone who's done it can tell
  922. me definitively.
  923.  
  924. Eric Baumgartner                   *  ebaum@dartmouth.edu
  925. Interactive Media Lab              *  - When in danger or in doubt,
  926. Dartmouth Medical School           *      run in circles, scream and
  927. shout.
  928.  
  929.  
  930.  
  931. - -------------------------
  932.  
  933. From: TOGE@SLACVM.SLAC.STANFORD.EDU (Nobukazu Toge)
  934. Subject:  PICT creation in temp. memory... how?
  935. Date: 9 Feb 92 20:58:52 GMT
  936. Organization: Stanford Linear Accelerator Center
  937.  
  938. Eric J Baumgartner (Eric.J.Baumgartner@dartmouth.edu) asked -
  939.  
  940. > I want to be able to create a PICT in temporary memory in System 7,
  941. > rather than my applications partition.  Normally, I'd just do:
  942. >
  943. > PicHandle myPICT;
  944. >
  945. > myPICT = OpenPicture(&aRect);
  946. >
  947. > /* all the drawing and copybits commands */
  948. >
  949. > ClosePicture();
  950. >
  951. > IM 6 has calls to create a handle in temp memory, after which you can
  952. > use regular memory management functions.  But I can't use these with
  953. > OpenPicture, because it's "special"; it signals QD to begin capturing
  954. > calls.
  955. >
  956. > How do I do this?
  957.  
  958. I am curious to hear anyone's success story, too.  I think I know three
  959. possible work-arounds, but none of them I really fully tested -
  960.  
  961. 1. Diddle the QD bottle necks so that -
  962.     o Spool out the entire picture to a disk file first.
  963.     o Figure out the size of the picture when done.
  964.     o Request a temp memory knowing the picture's size.
  965.     o Dump the data back into the memory.
  966.     o Delete the pict file and pretend nothing has happened.
  967.     o This should work whether under sys-6 or 7.
  968.  
  969. 2. Fool the system by -
  970.     o Do a temp mem allocation call for a tiny small amount of memory.
  971.     o Find out the zone of the block that has been allocated. Discard
  972.       the tiny memoy block allocated in the first step.
  973.     o SetZone to that zone (that is, something like MF zone or ProcMgr?
  974.       zone).
  975.     o OpenPicture
  976.     o QD calls
  977.     o ClosePicture
  978.     o SetZone back to your application zone.
  979.  
  980. 3. Fool the OpenPicture by -
  981.     o Knowing that OpenPicture makes a couple of (three?) NewHandle calls,
  982.     o Patch NewHandle, right before calling OpenPicture, so that a
  983.       NewHandle call in fact calls TempNewHandle.  I guess this patch will
  984.       have to be a tail-patch, so we need to watch out.
  985.     o OpenPicture
  986.     o QD calls
  987.     o ClosePicture
  988.     o Unpatch NewHandle
  989.     o Probably only under sys 7, this may be ok.
  990.  
  991. I have tried 1 and it basically works OK.  Since everything is within the
  992. "legal" framework of IM, I think it's the safest.
  993. I have tried 2, and it didn't work well (back in sys-6 days).  It was
  994. upsetting MF badly, but it may be because I was doing the entire thing from
  995. within another trap patch... or maybe I simply had some code errors.
  996. I have never tried 3... it's just an idea.  [In my case the problem was that
  997. in general I do not know the size of the picture yet when I call OpenPicture]
  998.  
  999. Regards,
  1000.  
  1001. - Nobu Toge (Stanford Linear Accelerator Center)
  1002.  
  1003. * My employer SLAC, Stanford University and U.S. DoE are not reponsible
  1004. * for this posting.  My opinion is only mine, unless someone else shares
  1005. * it.
  1006.  
  1007.  
  1008.  
  1009. - -------------------------
  1010.  
  1011. From: kaufman@Xenon.Stanford.EDU (Marc T. Kaufman)
  1012. Subject:  PICT creation in temp. memory... how?
  1013. Date: 9 Feb 92 23:32:32 GMT
  1014. Organization: CS Department, Stanford University, California, USA
  1015.  
  1016. TOGE@SLACVM.SLAC.STANFORD.EDU (Nobukazu Toge) writes:
  1017.  
  1018. >Eric J Baumgartner (Eric.J.Baumgartner@dartmouth.edu) asked -
  1019.  
  1020. -> I want to be able to create a PICT in temporary memory in System 7,
  1021. -> rather than my applications partition.  Normally, I'd just do:
  1022. ->...
  1023. -> IM 6 has calls to create a handle in temp memory, after which you can
  1024. -> use regular memory management functions.  But I can't use these with
  1025. -> OpenPicture, because it's "special"; it signals QD to begin capturing
  1026. -> calls.
  1027. ->
  1028. -> How do I do this?
  1029.  
  1030. >I am curious to hear anyone's success story, too.  I think I know three
  1031. >possible work-arounds, but none of them I really fully tested -
  1032.  
  1033. >1. Diddle the QD bottle necks so that -
  1034. >    o Spool out the entire picture to a disk file first.
  1035. >    o Figure out the size of the picture when done.
  1036. >    o Request a temp memory knowing the picture's size.
  1037. >    o Dump the data back into the memory.
  1038. >    o Delete the pict file and pretend nothing has happened.
  1039. >    o This should work whether under sys-6 or 7.
  1040.  
  1041. Why not just replace the picSpool bottleneck and move the data to the
  1042. temp memory handle (growing the handle if necessary), rather than putting
  1043. it on disk first and then reading it in?
  1044.  
  1045. -- 
  1046. Marc Kaufman (kaufman@CS.Stanford.EDU)
  1047.  
  1048.  
  1049.  
  1050. - -------------------------
  1051.  
  1052. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  1053. Subject:  PICT creation in temp. memory... how?
  1054. Date: 10 Feb 92 01:27:30 GMT
  1055. Organization: University of Waikato, Hamilton, New Zealand
  1056.  
  1057. Put it in the system heap!
  1058.  
  1059.     SetZone(SystemZone());
  1060.     MyPicture := OpenPicture(Bounds);
  1061.     SetZone(PreviousZone);
  1062.     ...
  1063.     ClosePicture
  1064.  
  1065. The system heap is a LOT simpler to deal with than the MultiFinder heap--
  1066. no special rules about which Memory Manager calls will or will not work
  1067. under which system version, and you can get just about any part of the
  1068. system to do its memory allocation there--as witness the above example.
  1069.  
  1070. Just remember to check that MultiFinder/Process Manager is actually
  1071. present (by testing for the $A88F trap) before doing this.
  1072.  
  1073. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  1074. Computer Services Dept                     fax: +64-7-838-4066
  1075. University of Waikato            electric mail: ldo@waikato.ac.nz
  1076. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00
  1077. To someone with a hammer and a screwdriver, every problem looks
  1078. like a nail with threads.
  1079.  
  1080.  
  1081.  
  1082. ---------------------------
  1083.  
  1084. From: kimd@hpcvlx.cv.hp.com. (Kim Drongesen)
  1085. Subject: MacApp 2.01 w/ C++ Undo Problems
  1086. Date: 7 Feb 92 18:01:11 GMT
  1087. Organization: Hewlett-Packard Co., Corvallis, OR, USA
  1088.  
  1089. I am running MacApp 2.01 and using C++.  I have been implementing the cut/copy/
  1090. clear functionality for my application, and can not get the 'Undo' menu 
  1091. item to highlight.  All 3 of the command appear to work, and  I
  1092. can get my 'cut' items to appear in the clipboard.  However, after the
  1093. command has been executed, the Undo menu remains disabled (although it
  1094. does say 'Undo Cut', 'Undo Clear', or whatever).
  1095.  
  1096. I looked in the MacApp programmer's manual last night, it said that Undo
  1097. would be enabled (by MacApp) when the following circumstances are true:
  1098.  
  1099. 1.  You create and return a TCommand* object from your DoMenuCommand
  1100. method.
  1101.  
  1102. 2.  The fCanUndo field of that object is set to true.
  1103.  
  1104. 3.  The DoIt command for the command object has been executed (which
  1105. sets the fCmdDone field of the command object to true).
  1106.  
  1107. 4.  There has not been another command executed since your command was
  1108. created.
  1109.  
  1110. I bring up an inspector window - and for all of the above except 4, I can
  1111. verify that these have been done.  Since I only create a Command object
  1112. in this portion of my code,  I can't imagine that another Command is being
  1113. created (unless MacApp is doing it).
  1114.  
  1115. I would appreciate any help from anyone who has seen this before, but I
  1116. would also appreciate any debugging tips.  How do I figure out what magic
  1117. incantation MacApp is conjuring up to figure out that the Undo item needs
  1118. to be disabled?
  1119.  
  1120. Any and all suggestions are welcome!!
  1121.  
  1122. Thanks in advance,
  1123.  
  1124. Kim Drongesen
  1125. kimd@cv.hp.com
  1126.  
  1127.  
  1128.  
  1129. - -------------------------
  1130.  
  1131. From: ksand@apple.com (Kent Sandvik)
  1132. Subject:  MacApp 2.01 w/ C++ Undo Problems
  1133. Date: 9 Feb 92 23:48:21 GMT
  1134. Organization: MacDTS Mongols
  1135.  
  1136. In article <101780010@hpcvlx.cv.hp.com.>, kimd@hpcvlx.cv.hp.com. (Kim Drongesen) writes:
  1137. > I am running MacApp 2.01 and using C++.  I have been implementing the cut/copy/
  1138. > clear functionality for my application, and can not get the 'Undo' menu 
  1139. > item to highlight.  All 3 of the command appear to work, and  I
  1140. > can get my 'cut' items to appear in the clipboard.  However, after the
  1141. > command has been executed, the Undo menu remains disabled (although it
  1142. > does say 'Undo Cut', 'Undo Clear', or whatever).
  1143.  
  1144. Have you created a buzzword entry in the resource file, something
  1145. like (ad hoc):
  1146.  
  1147. resource 'cmnu' (128){
  1148.     128,
  1149.  textMenuProc,
  1150.  allEnabled,
  1151.  enabled,
  1152.  "Buzzwords",
  1153.  {
  1154.      "My Undo Command", noIcon, noKey, noMark, plain, cMyUndoCommand;
  1155.  }
  1156. };
  1157.  
  1158. Note that this menu cmnu is *not* added to the MBAR resource listing.
  1159.  
  1160. Don't know if this was the problem... Check out the examples in
  1161. the MacApp 2.0.1 distribution, such as Calc.
  1162.  
  1163. (Kent-Sandvik)
  1164.  
  1165.  
  1166.  
  1167. - -------------------------
  1168.  
  1169. From: mcmath@csb1.nlm.nih.gov (Chuck McMath)
  1170. Subject:  MacApp 2.01 w/ C++ Undo Problems
  1171. Date: 10 Feb 92 12:49:43 GMT
  1172. Organization: MSD
  1173.  
  1174. In article <101780010@hpcvlx.cv.hp.com.>, kimd@hpcvlx.cv.hp.com. (Kim Drongesen) writes:
  1175. > I am running MacApp 2.01 and using C++.  I have been implementing the cut/copy/
  1176. > clear functionality for my application, and can not get the 'Undo' menu 
  1177. > item to highlight.  All 3 of the command appear to work, and  I
  1178. > can get my 'cut' items to appear in the clipboard.  However, after the
  1179. > command has been executed, the Undo menu remains disabled (although it
  1180. > does say 'Undo Cut', 'Undo Clear', or whatever).
  1181. >   (stuff deleted)
  1182. >
  1183. > Any and all suggestions are welcome!!
  1184. > Thanks in advance,
  1185. > Kim Drongesen
  1186. > kimd@cv.hp.com
  1187.  
  1188. It might have something to do with the document of your cut, copy, etc. When
  1189. you create the command you have to give it a document, right?  If that doc
  1190. is not in the target chain then the undo menu item will have the correct
  1191. text, but will not be enabled.  Check out the code in TApplication.SetupTheMenus
  1192. (following is a comment from that method):
  1193.  
  1194.               { Enable Undo only if the last command was not document-specific
  1195.                or the document changed is the current document. }
  1196.  
  1197. So, it will only enable Undo if the document passed was NIL or was the same as the
  1198. document in the target chain.
  1199.  
  1200. Hope this helps,
  1201.  
  1202. chuck
  1203.  
  1204.                        --chuck mcmath-
  1205.                     mcmath@csb1.nlm.nih.gov
  1206.   MSD, Inc. * National Library of Medicine * National Institutes of Health
  1207.                        Bethesda, MD 20894
  1208.  
  1209.  "Competing in the 1994 Winter Olympics newest demonstration sport - snow angels!"
  1210.  
  1211.  
  1212.  
  1213. ---------------------------
  1214.  
  1215. End of C.S.M.P. Digest
  1216. **********************
  1217.